<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/10/10
  Time: 17:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function sendServlet(str) {
            alert(str);
            str = encodeURI(str);//加密两次，网页解一次，自己解一次
            str = encodeURI(str);
            alert(str);
            location.href="demob?name="+str;
        }
    </script>
</head>
<body>
<a href="javascript:sendServlet('张三')">去a</a>
</body>
</html>
